package day06;

import java.sql.SQLOutput;

public class MethodDemo {
    public static void main(String[] args) {

        aMethod();
        System.out.println(444);

//        say();
//        sayHi("马云峰");
        sayHello("张代伟",35);
        sayHello("马云峰",66);

        /*
        double a= getNum();
        System.out.println(8.88);
        int b=plus(5,6);
        System.out.println(b);
        int m=5;int n=6;
        int c=plus(m,n);
        System.out.println(c);

        int[]arr=testArray(5,100);
        System.out.println("数组的长度是:"+arr.length);
        int[]brr=testArray(10,100);
        System.out.println("第一个元素的值为:"+brr[0]);
        for (int i=0;i<brr.length;i++){
            brr[i]=(int)(Math.random()*100);
            System.out.println(brr[i]);
            System.out.println(brr.length);
        }

         */

    }
    public static void say(){
        System.out.println("哈喽!马云峰太调皮了!");
    }
    public static void sayHi(String name){
        System.out.println("大家好，我隔壁同同桌叫"+name+"。今年23岁了!");
    }
    public static void sayHello(String name ,int age){
        if (age>60){
            return;
        }
        System.out.println("大家好，我叫"+name+"。今年"+age+"岁了!");
    }
    public static double  getNum(){

        //return;//编译错误，return后必须跟一个数组
        //return"abc";return后的数据类型
        return 8.88;
    }
    public static int plus(int num1,int num2){
        int num=num1+num2;
        return num;
    }
    public static int []testArray(int len,int max){
        int[]arr=new int[len];
        for (int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*(max+1));
        }
        return arr;
    }
    public static void aMethod(){
        System.out.println(111);
        bMethod();
        System.out.println(222);
    }
    public static void bMethod(){
        System.out.println(333);
    }
}
